{% extends 'base_with_top_menu.html' %}

{% load go_back_link %}

{% block title %}Request for book{% endblock %}

{% block header %}Request for book{% endblock %}

{% block content %}

{% if show_confirmation_msg %}
    <div class="msg_wrapper">
      <div class="confirmation_msg">
        <p>Thank you for your request.
        {% if perms.baseapp.list_bookrequests %}
          You can see <a href="{% url bookrequest_active %}">all requests here</a>.
        {% endif %}
        </p>
      </div>
    </div>
{% endif %}

{% if form_content %}
    {% if display_tips %}
        <div class="usage_info tip">
            <p>Do you need a book not present in library? Or... all copies of book you need are reserved? Here you can make such suggestion.</p>
            <p>If you want to <em>request another copy of existing book</em> use <a href="{% url book_all %}">book searching</a> to find it
              first. Then click <em>Request another copy</em>.
            </p>
        </div>
    {% endif %}

    <div class="formWrapper">
        <div class="non_field_errors">
            {{ form_content.non_field_errors }}
        </div>

        <form class="book_request_form" action="." method="POST" name="Frequest">
          <center>
            <table class="basic_fields">
            <tbody>
              {% if requesting_copy %}
                <tr>
                    <td>
                      {{form_content.book.label}}:
                      <p style="margin-left:3em">{{ related_book.title }}</p>
                    </td>
                </tr>
              {% endif %}
                <tr>
                    <td>   {{form_content.info.label}}:
                      <br/>{{form_content.info}}
                      <br/>{{form_content.info.errors}}   </td>
                </tr>
                <tr>
                    <td>  <input type="submit" value="Send request"/>  </td>
                    <td></td>
                </tr>
            </tbody>
            </table>

            <div style="display:none">
              <br/>{{form_content.book}}
              <br/>{{form_content.book.errors}}
            </div>
          </center>
        </form>
    </div>
    <script type="text/javascript">
      document.Frequest.book.focus();
    </script>

{% endif %}

{% go_back_link %}

{% endblock %}
